#include<bits/stdc++.h>
using namespace std;
inline int read(){
	int x=0;bool f=0;char ch=getchar();
	while(ch<'0'||ch>'9')f^=(ch=='-'),ch=getchar();
	while('0'<=ch&&ch<='9')x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return f?-x:x;
}
const int Maxn=1e5+5;
int n,m;
char s[Maxn],t[Maxn];
vector<int>ans;
int main(){
//	freopen("seq.in","r",stdin);
//	freopen("seq.out","w",stdout);
	scanf("%s",s+1);scanf("%s",t+1);
	n=strlen(s+1);m=strlen(t+1);
	int l=1;
	for(int i=1;i<=n;i++){
		if(l<=m&&t[l]==s[i])l++,ans.push_back(i);
	}
	if(l!=m+1)puts("NO"),exit(0);
	int ok=0;
	for(int i=ans[m-1]+2;i<=n;i++)ok+=(s[i-1]!=s[i]);
	if(ok)puts("NO"),exit(0);
	puts("YES");
	for(int i=0;i<m;i++)printf("%d ",ans[i]);
	return 0;
}
/*
11101110111011101110111
00000
*/
